$(function () {
    // 获取导航信息
    $.ajax({
        type: 'get',
        url: 'http://127.0.0.1:8081/qiantai/mutual',
        data: {},
        success: function (data) {
            let {detail,endTime,idea,ideaEnglish,name,nameEnglish,phone,profile,startTime,title} = data.commpany;
            $("#name").html(name);
            $("#nameEnglish").html(nameEnglish);
            $("#phone").html(phone);
            var startT = startTime.substring(0,startTime.length-3);
            var endT = endTime.substring(0,endTime.length-3);
            $("#start_end_time").html("("+startT+"———"+endT+")");
            $("#idea").html(idea);
            $("#ideaEnglish").html("<i>"+ideaEnglish+"</i>");
            $("#profile").html(profile);
            $("#title").html(title);
            $("#detail").html(detail);

            $(data.navList).each(function (index, item) {
                let nav = "<li class='a-href'>\n" +
                    "                                    <a href='"+item.url+"' onclick='destroyId()'>"+item.name+"</a>\n" +
                    "                                </li>"
                let navs = "<li>\n" +
                    "                        <a href='"+item.url+"' onclick='destroyId()'>"+item.name+"</a>\n" +
                    "                    </li>"
                $("#nav").append(nav);
                //底部
                $("#navs").append(navs);
            });
        },
        error: function () {
            layui.layer.msg('请求接口异常,请刷新重试！',{icon:0,time:1300});
            return false;
        }
    })
})

/**
 * 存储点击事件Id和跳转相应url页面
 * @param id
 * @param url
 */
function findById(id,url) {
    sessionStorage.setItem("id",id);
    window.location.href=url;
}

/**
 * 存储点击图片路径和跳转页面路径
 * @param imgUrl
 * @param url
 */
function findByimgUrl(imgUrl,url) {
    sessionStorage.setItem("img",imgUrl);
    window.location.href=url;
}

document.writeln("<!-- 头部 -->");
document.writeln("    <div class=\'head\'>");
document.writeln("        <div class=\'top\'>");
document.writeln("            <div>");
document.writeln("                <!-- 公司名称及标识 -->");
document.writeln("                <div class=\'company-name-icon\' >");
document.writeln("                    <div class=\'company-1name-icon\' >");
document.writeln("                        <!-- 图标 -->");
document.writeln("                        <div class=\'company-icon\' >");
document.writeln("                            <img src=\'../img/logo_03_2rrh.png\'>");
document.writeln("                        </div>");
document.writeln("                        <!-- 公司名称 -->");
document.writeln("                        <div>");
document.writeln("                            <span class=\'company-name\' id=\'name\'>华康科技有限公司</span>");
document.writeln("                        </div>");
document.writeln("                        <div>");
document.writeln("                            <em class=\'company-1name\'>");
document.writeln("                                <span id=\'nameEnglish\'>IT-technology Co. Ltd.</span>");
document.writeln("                            </em>");
document.writeln("                        </div>");
document.writeln("                    </div>");
document.writeln("                    <!-- 横线 -->");
document.writeln("                    <div>");
document.writeln("                        <div class=\'horizontal-solid\'></div>");
document.writeln("                    </div>");
document.writeln("                </div>");
document.writeln("                <div>");
document.writeln("                    <!-- 电话LogO及客服 -->");
document.writeln("                    <div class=\'phoneService\'>");
document.writeln("                        <div class=\'phone-icon\'>");
document.writeln("                            <img src=\'../img/9_2ach.png\'>");
document.writeln("                        </div>");
document.writeln("                        <div class=\'phone-service\'>");
document.writeln("                            <span>客服电话：</span>");
document.writeln("                        </div>");
document.writeln("                        <div class=\'phone-1service\'>");
document.writeln("                            <span id=\'phone\'></span>");
document.writeln("                        </div>");
document.writeln("                        <div class=\'phone-2service\'>");
document.writeln("                            <span id=\'start_end_time\'></span>");
document.writeln("                        </div>");
document.writeln("                    </div>");
document.writeln("                    <!-- 菜单栏 -->");
document.writeln("                    <div>");
document.writeln("                        <div class=\'nav-icon\'>");
document.writeln("                            <img src=\'../img/2_iqzt.png\' />");
document.writeln("                        </div>");
document.writeln("                        <!-- 导航 -->");
document.writeln("                        <div class=\'nav\'>");
document.writeln("                            <ul id=\'nav\'>");
document.writeln("                            </ul>");
document.writeln("                        </div>");
document.writeln("                    </div>");
document.writeln("                </div>");
document.writeln("            </div>");
document.writeln("        </div>");
document.writeln("        <!-- 头部公司文字简介 -->");
document.writeln("        <div class=\'company-wenzi\'>");
document.writeln("            <div class=\'wenzi\'>");
document.writeln("                <div class=\'company-1wenzi\'>");
document.writeln("                    <span id=\'idea\'></span>");
document.writeln("                </div>");
document.writeln("                <div class=\'company-2wenzi\'>");
document.writeln("                    <div >");
document.writeln("                        <span id=\'ideaEnglish\'></span>");
document.writeln("                    </div>");
document.writeln("                </div>");
document.writeln("            </div>");
document.writeln("        </div>");
document.writeln("    </div>");